<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        function loadImage(src, resolve) {
            let image = new Image();
            image.src = src;
            image.onload = resolve;
            image.onerror = reject;
        }
        loadImage("images/houdunren.png", () => {
            console.log('图片加载完成');
        }, () => {
            console.log('加载失败');
        });
    </script>
</body>

</html>